import React, { PureComponent } from 'react'

import {createPortal} from 'react-dom'

export class App extends PureComponent {
  render() {
    return (
      <div>
        <h1>app h1</h1>
        {/* <h2>app h2</h2> */}
        {
          // 将当前元素挂在到指定dom 下面
          createPortal(<h2>app h2</h2>,document.querySelector('body'))
        }
      </div>
    )
  }
}

export default App